package ooday05;

public class Test {
    public static void main(String[] args) {
        Person []ps=new Person[5];
        ps[0]=new Student("zs",34,"zc","111");
        ps[1]=new Student("zs",34,"zc","222");
        ps[2]=new Teacher("zs",34,"zc",7879);
        ps[3]=new Teacher("zs",34,"zc",6889);
        ps[4]=new Doctor("zs",34,"zc","经理");

        for (int i = 0; i < ps.length; i++) {
            Person p=ps[i];
            System.out.println(p.name);
            p.sayHi();
        }
    }
}
